package com.sky.business.sys.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.sky.business.sys.domain.CameraConfig;
import com.sky.business.sys.domain.SystemConfig;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;


@Data
public class CameraConfigVO2 {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "ID")
    private Long id;

    @Schema(description = "摄像头设备ID")
    private String cameraDeviceId;

    @Schema(description = "摄像头IP地址")
    private String cameraIp;

    @Schema(description = "摄像头端口")
    private String cameraPort;

    @Schema(description = "摄像头rtsp端口")
    private String cameraRtspPort;

    @Schema(description = "ONVIF用户名")
    private String onvifUser;

    @Schema(description = "ONVIF密码")
    private String onvifPasswd;

    @Schema(description = "摄像头纬度")
    private String cameraLongitude;

    @Schema(description = "摄像头经度")
    private String cameraLatitude;

    @Schema(description = "水平误差角")
    private String panAngle;

    @Schema(description = "垂直误差角")
    private String tiltAngle;

    @Schema(description = "摄像头最小焦距")
    private String cameraFocalLenMin;

    @Schema(description = "摄像头变焦范围最大值")
    private String cameraZoomRangeMax;

    @Schema(description = "摄像头垂直旋转范围最小值")
    private String cameraTiltRangeMin;

    @Schema(description = "摄像头垂直旋转范围最大值")
    private String cameraTiltRangeMax;


    @Schema(description = "推流地址")
    private String pushStream;

    @Schema(description = "拉流地址")
    private String pullStream;

    @Schema(description = "ai拉流地址")
    private String aiPullStream;

    @Schema(description = "最小变倍比例")
    private String minZoomRatio;

    @Schema(description = "最大变倍比例")
    private String maxZoomRatio;

    @Schema(description = "自动变倍（开关）")
    private Boolean autoZoom;

    @Schema(description = "像元尺寸")
    private String pixelSize;

    @Schema(description = "无人机真实宽")
    private String objWidth;

    @Schema(description = "无人机真实高")
    private String objHeight;

    @Schema(description = "水平移动阈值")
    private String horizontalMoveThreshold;

    @Schema(description = "垂直移动阈值")
    private String verticalMoveThreshold;

    @Schema(description = "设备类型，1：海康，2：大华，3：自研 40倍，4：自研88倍")
    private String deviceType;

    @Schema(description = "无人机在画面的比例")
    private String ratio;

    public CameraConfigVO2(CameraConfig camera, SystemConfig systemConfig) {
        if(camera!=null){
            this.id = camera.getId();
            this.cameraDeviceId = camera.getCameraDeviceId();
            this.cameraIp = camera.getCameraIp();
            this.cameraPort = camera.getCameraPort();
            this.cameraRtspPort = camera.getCameraRtspPort();
            this.onvifUser = camera.getOnvifUser();
            this.onvifPasswd = camera.getOnvifPasswd();
            this.cameraLongitude = camera.getCameraLongitude();
            this.cameraLatitude = camera.getCameraLatitude();
            this.panAngle = camera.getPanAngle();
            this.tiltAngle = camera.getTiltAngle();
            this.cameraFocalLenMin = camera.getCameraFocalLenMin();
            this.cameraZoomRangeMax = camera.getCameraZoomRangeMax();
            this.cameraTiltRangeMin = camera.getCameraTiltRangeMin();
            this.cameraTiltRangeMax = camera.getCameraTiltRangeMax();
            this.pushStream = camera.getPushStream();
            this.pullStream = camera.getPullStream();
            this.aiPullStream = camera.getAiPullStream();
            this.minZoomRatio = systemConfig.getMinZoomRatio();
            this.maxZoomRatio = systemConfig.getMaxZoomRatio();
            this.autoZoom = camera.getAutoZoom();
            this.pixelSize = camera.getPixelSize();
            this.objHeight = systemConfig.getObjHeight();
            this.objWidth = systemConfig.getObjWidth();
            this.horizontalMoveThreshold = systemConfig.getHorizontalMoveThreshold();
            this.verticalMoveThreshold = systemConfig.getVerticalMoveThreshold();
            this.deviceType = camera.getDeviceType();
            this.ratio = systemConfig.getRatio();
        }

    }
}
